package cn.tedu.medicalmanagementsystem.base.config;

import cn.tedu.medicalmanagementsystem.base.interceptors.EscortLoginInterceptor;
import cn.tedu.medicalmanagementsystem.base.interceptors.JwtInterceptor;
import cn.tedu.medicalmanagementsystem.base.interceptors.ManagerLoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration//当前类为配置类
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JwtInterceptor())
                .addPathPatterns("/v1/escort/**")
                .excludePathPatterns("/v1/escort/register", "/v1/escort/login");
    }
}

